﻿namespace EventsExample
{
    using System;
    using System.Diagnostics;
    using System.Text;
    using System.Timers;
    using DelegatesExample;

    public class MainEventsExample
    {
        private static void PrintEachThreeSec(object sender, ElapsedEventArgs e)
        {
            Console.WriteLine("3 secs");
        }

        private static void Main()
        {
            System.Timers.Timer theTimer = new System.Timers.Timer();
            theTimer.Interval = 3000;
            theTimer.Elapsed += PrintEachThreeSec;
            theTimer.Start();

            DelegatesExample.Timer.Interval = 1;

            while (true)
            {
                DelegatesExample.Timer.ExecuteEachOneSec();
            }
        }
    }
}